/***********************************************************
 * Product Name: ExcelQuicker
 * Copyright (c)2005, Eunge
 * Author: Eunge
 * Web Site: www.eudev.net
 * Mail/MSN: eudev.net@yeah.net
 * ********************************************************/
using System;
using System.Collections;

namespace ExcelQuicker.Framework
{
	/// <summary>
	/// Collection of EQRangeBase
	/// </summary>
	[Serializable]
	sealed public class EQRangeBaseCollection: EQCollection
	{
		/// <summary>
		/// Add a new object derived from EQRangeBase
		/// </summary>
		/// <param name="objEQRangeBase"></param>
		public void Add(EQRangeBase objEQRangeBase)
		{
			base.Add (objEQRangeBase);
		}

		/// <summary>
		/// Remove object derived from EQRangeBase
		/// </summary>
		/// <param name="objEQRangeBase"></param>
		public void Remove(EQRangeBase objEQRangeBase)
		{
			base.Remove(objEQRangeBase);
		}

		/// <summary>
		/// Add a new object derived from EQRangeBase at specialized position
		/// </summary>
		/// <param name="index"></param>
		/// <param name="objEQRangeBase"></param>
		public void Insert(int index, EQRangeBase objEQRangeBase)
		{
			base.Insert(index, objEQRangeBase);
		}

		/// <summary>
		/// Get the index of objEQRangeBase in current collection
		/// </summary>
		/// <param name="objEQRangeBase"></param>
		/// <returns></returns>
		public int IndexOf(EQRangeBase objEQRangeBase)
		{
			return base.IndexOf(objEQRangeBase);
		}

		/// <summary>
		/// Check the objEQRangeBase whether exists in the current collection
		/// </summary>
		/// <param name="objEQRangeBase"></param>
		/// <returns></returns>
		public bool Contains(EQRangeBase objEQRangeBase)
		{
			return base.Contains(objEQRangeBase);
		}

		/// <summary>
		/// Set/Get EQRangeBase object by setting index
		/// </summary>
		public new EQRangeBase this[int index]
		{
			get
			{
				return base[index] as EQRangeBase;
			}
			set
			{
				base[index] = value;
			}
		}

		/// <summary>
		/// Copy the object which its index more from index to objEQRangeBaseCollection
		/// </summary>
		/// <param name="objEQRangeBaseCollection"></param>
		/// <param name="index"></param>
		public void CopyTo(EQRangeBaseCollection objEQRangeBaseCollection, int index)
		{
			base.CopyTo(objEQRangeBaseCollection, index);
		}	


		/// <summary>
		/// Output all objects exists in current collection to excel document
		/// </summary>
		/// <param name="objWorksheet"></param>
		internal void Output(Excel.Worksheet objWorksheet)
		{
			IEnumerator objIEnumerator = this.GetEnumerator();
			while(objIEnumerator.MoveNext())
				(objIEnumerator.Current as EQRangeBase).Output(objWorksheet);
		}
	}
}
